.class Lcom/trademob/tracking/TMDeviceIdentifier;
.super Ljava/lang/Object;
.source "TMDeviceIdentifier.java"


# instance fields
.field private final myCryptography:Lcom/trademob/tracking/TMCryptography;

.field private final myMD5:Ljava/lang/String;

.field private final myMD5Short:Ljava/lang/String;

.field private final mySHA1:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 3
    .parameter "aString"

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 25
    new-instance v0, Lcom/trademob/tracking/TMCryptography;

    invoke-direct {v0}, Lcom/trademob/tracking/TMCryptography;-><init>()V

    iput-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myCryptography:Lcom/trademob/tracking/TMCryptography;

    .line 26
    const-string v0, "0"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 28
    const-string v0, "0"

    iput-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myMD5Short:Ljava/lang/String;

    .line 34
    :goto_0
    iget-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myCryptography:Lcom/trademob/tracking/TMCryptography;

    const-string v1, "MD5"

    invoke-virtual {v0, p1, v1}, Lcom/trademob/tracking/TMCryptography;->encrypt(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myMD5:Ljava/lang/String;

    .line 35
    iget-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myCryptography:Lcom/trademob/tracking/TMCryptography;

    const-string v1, "SHA1"

    invoke-virtual {v0, p1, v1}, Lcom/trademob/tracking/TMCryptography;->encrypt(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->mySHA1:Ljava/lang/String;

    .line 36
    return-void

    .line 32
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "X"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const/4 v1, 0x4

    const/16 v2, 0x18

    invoke-direct {p0, v1, v2, p1}, Lcom/trademob/tracking/TMDeviceIdentifier;->md5String(IILjava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myMD5Short:Ljava/lang/String;

    goto :goto_0
.end method

.method private md5String(IILjava/lang/String;)Ljava/lang/String;
    .locals 3
    .parameter "from"
    .parameter "length"
    .parameter "aString"

    .prologue
    .line 74
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 75
    .local v0, result:Ljava/lang/StringBuilder;
    iget-object v1, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myCryptography:Lcom/trademob/tracking/TMCryptography;

    const-string v2, "MD5"

    invoke-virtual {v1, p3, v2}, Lcom/trademob/tracking/TMCryptography;->encrypt(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 76
    const/4 v1, 0x0

    invoke-virtual {v0, v1, p1}, Ljava/lang/StringBuilder;->delete(II)Ljava/lang/StringBuilder;

    .line 77
    if-lez p2, :cond_0

    .line 79
    add-int/lit8 v1, p2, -0x1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->setLength(I)V

    .line 81
    :cond_0
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method


# virtual methods
.method public MD5()Ljava/lang/String;
    .locals 1

    .prologue
    .line 51
    iget-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myMD5:Ljava/lang/String;

    return-object v0
.end method

.method public MD5_24()Ljava/lang/String;
    .locals 1

    .prologue
    .line 43
    iget-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->myMD5Short:Ljava/lang/String;

    return-object v0
.end method

.method public SHA1()Ljava/lang/String;
    .locals 1

    .prologue
    .line 61
    iget-object v0, p0, Lcom/trademob/tracking/TMDeviceIdentifier;->mySHA1:Ljava/lang/String;

    return-object v0
.end method
